
$(function() {
	$('#continent').selectChain({
		target: $('#country'),
		key: "code",
		value: "name",
		url: 'info.php?do=Country.ajax_continent',
		data: { ajax: false }
	});

	// $("#country").attr("value", $("#country_").val());

	var validator_edit = $("#form_edit").validate({
		rules: {			
			name: {
				required: true,
				minlength: 2
			},
			address: "required",
			contact: "required",
			tel: "required",
			email: {
				required: true,
				email: true
			}
		},
		messages: {
			code: {
				required: "请输入编号",
				remote: jQuery.format("{0} 已经存在")
			},
			status: {
				required: "请选择一个状态"
			}
		},
		errorPlacement: function(label, element) {
			if (/^birthdate/.test(element[0].name)) {
				label.insertAfter("#birthdateYear");
			} else {
				label.insertAfter(element);
			}
		},
		success: function(label) {
			label.html("&nbsp;").addClass("checked");
		}
	});

	$('textarea').css("width", 400);
});